package br.com.caelum.vraptor.components;

import java.io.Serializable;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import br.com.caelum.vraptor.entidades.Administrador;

@SessionScoped
@Named("administradorweb")
public class AdministradorWeb implements Serializable{
	
	private Administrador administrador;
	
	public void login(Administrador administrador){
		this.administrador = administrador;
	}
	
	public void logout(){
		this.administrador = null;
	}
	
	public String getNome(){
		return administrador.getNome();
	}
	
	public String getLogin(){
		return administrador.getLogin();
	}
	
	public boolean isLogado(){
		return administrador != null;
	}
	public int getId(){
		return administrador.getId();
	}

}
